Field of the Invention
The present invention relates to a buffer control apparatus for the compression of video intraframes, and more particularly to a buffer control apparatus for the compression of motion-involving video intraframes, capable of stably controlling a buffer even when a scene change occurs and simply realizing the buffer control, by the use of a combination of a feed-forward-based buffer control and a feed-back-based buffer control.
As a buffer control method used for the compression of motion-involving video intraframes, there have been generally known a feed-back-based buffer control method and a feed-forward-based buffer control method.
Referring to FIG. 1, there is illustrated a known feed-back-based buffer control apparatus. As shown in FIG. 1, the buffer control apparatus includes a frame memory 10 for storing input video frame data therein, an encoder 20 for encoding data output from the frame memory 10, a buffer 30 for transmitting encoded data output from the encoder 20 to a downstream constant rate channel(not shown), and a quantization parameter selector 40 for sending a division factor (DF) value (i.e., step size) corresponding to the quantity of data outputted from the buffer 30 to the encoder 20 and thereby controlling the quantity of data output from the buffer 30.
The encoder 20 includes a discrete cosine transform (DCT) circuit 21 adapted to carry out a DCT operation upon the video data outputted from the frame memory 10 in units of 8.times.8 blocks, a quantizer 22 adapted to quantize data output from the DCT circuit 21, and a variable length coding (VLC) circuit 23 adapted to variable length encode the quantized data outputted from the quantizer 22.
The operation of the feed-back-based buffer control apparatus having the above-mentioned construction will now be described.
Upon receiving video frame data from the frame memory 10, the DCT circuit 21 carries out a DCT operation upon the video frame data and sends the resultant DCT video data to the quantizer 22. The DCT video data received from the DCT circuit 21 is then quantized in the quantizer 22 under a control of the quantization parameter selector 40. The resultant quantized data is then sent to the VLC circuit 23 which, in turn, encodes the received data and sends the resultant encoded quantized (i.e., compressed) data to the buffer 30. Thereafter, the buffer 30 sends the received encoded quantized data to the downstream constant rate channel. During the quantizing operation of the quantizer 22, the quantization parameter selector 40 controls the quantizer 22 in order to control the quantity of data outputted from the buffer 30 to the downstream constant rate channel.
The quantity of data generated from the encoder 20 is determined depending on the step size set in the quantizer 22. In other words, when the quantization parameter selector 40 increases the value of the DF on the basis of the condition of the buffer 30 and sends the DF to the quantizer 22, the step size in the quantizer 22 is decreased correspondingly to the increased DF value. As a result, the quantity of data encoded in the encoder 20 is increased.
On the contrary, when the quantization parameter selector 40 decreases the value of the DF on the basis of a condition of the buffer 30 and sends the DF to the quantizer 22, the step size in the quantizer 22 is increased correspondingly to the decreased DF value, so that the quantity of data quantized in the quantizer 22 may be decreased. As a result, the quantity of data encoded in the encoder 20 is decreased.
On the other hand, there have been known the heuristic buffer control method and the statistical buffer control method employed as a feed-back-based buffer control method.
In accordance with the heuristic buffer control method, the DF values are controlled, depending on the fullness of the buffer based upon a buffer fullness (BF)-DF curve as shown in FIG. 2. In FIG. 2, the state of BF=0 represents the state where no data is contained in the buffer whereas the state of BF=1 represents the state where data is fully contained in the buffer.
If an inequality occurs between the quantity of data generated from the encoder 20 and the quantity of data outputted from the buffer 30, the quantity of data in the buffer 30 may be varied. When the quantity of data in the buffer is increased, corresponding to an increase in BF, a smaller DF is selected for a frame to be subsequently encoded, as apparent from the BF-DF curve of FIG. 2. As a result, the quantity of data generated is reduced. On the contrary, when the quantity of data in the buffer is decreased corresponding to a decrease in BF, a larger DF is selected for a frame to be subsequently encoded. As a result, the quantity of data generated is increased. Accordingly, the bit rate of data generated in the encoder 20 corresponds to the bit rate of data outputted from the buffer 30.
In the case of an initial state where an encoding operation begins or a state that a scene change occurs, a proper DF value can not be selected, so that an inequality may occur between the number of bits generated from the encoder 20 and the number of bits outputted from the buffer 30. In this case, both the BF value and the DF value of the buffer 30 are continuously varied until the buffer 30 reaches a stable state. When the buffer 30 reaches the stable state, the variation in BF and DF values is hardly generated, thereby causing the BF and DF values to be subsequently constant.
On the other hand, in accordance with the statistical buffer control method, the quantity of data to be generated from video data to be currently encoded is statistically estimated using the quantity of data obtained from video data encoded just prior to the encoding of the current video data and a DF value for the previous video data. Thereafter, a DF value corresponding to an estimated value most approximate to the quantity of data currently outputted from the buffer 30 is selected using a DF-bit curve as shown in FIG. 3.
Values in the DF-bit curve shown in FIG. 3 represent mean values of data quantities and deviation values respectively generated when six different test pictures, namely, a table tennis picture, a flower garden picture, a surge picture, a popple picture, a mobile and calendar picture, and a tempest picture are applied to a JPEG base line data compression algorithm while varying DF from 0 to 12 at a rate of 0.1.
Statistically, two successive video units in a video sequence have similar characteristics. Accordingly, they generate approximate numbers of bits for the same DF value. Using the number of bits n.sub.k (m) obtained from a video unit currently encoded and a corresponding DF value m, the number of bits n.sub.k+1 (P) from a next video unit to be subsequently encoded can be expressed by the following equation (1): ##EQU1##
Using the above equation (1), the number of bits is estimated for every DF value P, namely, each DF value ranging from 0 to 12. Thereafter, a DF value is selected which corresponds to the estimated bit number most approximate to the bit rate outputted from the buffer 30. In equation (1), "a(P)" stands for the amount of data in the case of DF=P whereas "d(P)" stands for a deviation in the same case.
In accordance with the above-mentioned buffer control method, the buffer 30 is controlled variably, depending on its state. The states of buffer 30 include a scene change state, an over-flow state and a normal state. In the normal state of buffer 30, the above-mentioned procedure is used. In the scene change state, the number of bits generated is adjusted to approximate the number of bits outputted from the buffer while varying the DF value several times. The buffer control is carried out only one time per frame in the normal state. Where the buffer 30 is filled with data to 95% of its capacity, it is at the over-flow state. In this case, a quantization involving the largest step size is used.
FIG. 4 is a block diagram illustrating a conventional feed-forward-based buffer control apparatus wherein the general feed-forward-based buffer control is applied to a JPEG data compression algorithm. In this case, video data outputted from a DCT circuit 50 is sent to a plurality of quantizers which, in turn, each compress the same received video data. The quantizers have different DF values. In FIG. 4, only the first one, the second one and the N-th one of the quantizers are shown and denoted by the reference numerals 61, 62 and 63, respectively. Among the quantizers, the one is selected which generates data most approximate in quantity to data outputted from a buffer 80. The output data from the selected quantizer is then sent to the buffer 80 via a corresponding one of the VLC circuits. In similar fashion to the quantizers, only the first one, the second one and the N-th one of the VLC circuits are shown and denoted by the reference numerals 71, 72 and 73, respectively.
In accordance with these conventional buffer control methods, however, insufficiently compressed video data has a possibility of causing an over-flow in buffer 80 because an operation initiating point of the buffer 80 is determined at a state where the fullness of the buffer is excessively high. On the contrary, excessively compressed video data has a possibility of causing an under-flow in buffer 80. Furthermore, the period of transition until the buffer reaches a stable state is lengthened when a scene change occurs. In this case, the buffer selects an erroneous DF value, thereby causing the number of bits generated in the encoder to be greatly increased. In order to absorb such a variation, the buffer should have a sufficient capacity. Where the buffer has an insufficient capacity, the variation in BF and DF values becomes severe, resulting in poor picture quality.
In the case of the feed-back-based statistical buffer control method, a scene change results in an erroneous estimation for the bit rate. Since a new DF is determined, based on the erroneously estimated bit rate, the number of output bits is greatly increased. For this buffer control method, accordingly, the buffer should also have a large capacity. Such a large buffer capacity results in a lengthened delay time in the buffer. In an application of a digital video cassette recorder, the number of tracks required per frame is determined for the maximum quantity of data generated. In this regard, a high variation in the quantity of encoded data results in the wastage of tape. Moreover, since the buffer should be controlled several times for every frame when a scene change occurs, its control becomes complex. Consequently, effective buffer control may not be practically realized.
On the other hand, the feed-forward-based buffer control method does not incur the problem encountered in the feed-back-based method in association with a scene change, because the quantity of input data received in the buffer is previously adjusted to approximate the quantity of output data. However, the feed-forward-based buffer control method requires a very large amount of computation. As a result, this method may not easily be realized practically. This method also has a problem of demanding a considerably larger amount of computation, as compared to the feed-back-based buffer control method.